/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package business;

import model.Employee;
import model.EmployeeManager;

/**
 *
 * @author Administrator
 */
public class CreateNewEmpCmd extends AbstractCommand {

    @Override
    public boolean execute(Object args) {
        if( EmployeeManager.getInstance().getEmployeeById(getEmployee().getId()) != null )
            return false;
        
        EmployeeManager.getInstance().addEmployee(getEmployee());
        return true;
    }
    private Employee employee;

    /**
     * @return the employee
     */
    public Employee getEmployee() {
        return employee;
    }

    /**
     * @param employee the employee to set
     */
    public void setEmployee(Employee employee) {
        this.employee = employee;
    }
}
